package com.cucn.eduservice.client;

import com.cucn.commonutils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 服务调用
 * -@FeignClient("service-vod")调用的服务名称
 *
 * @author KouChaoJie
 * @since: 2021/10/7 19:52
 */
@Component
@FeignClient(name = "service-vod", fallback = VodFileDegradeFeignClient.class)
public interface VodClient {

    /**
     * 定义调用的方法路径
     *
     * @param id 删除视频对应id
     * @return Result统一结果
     */
    @DeleteMapping("/eduvod/video/removeAlyVideo/{id}")
    Result removeAlyVideo(@PathVariable("id") String id);

    /**
     * 批量删除视频
     * 参数传递多个视频id
     *
     * @param videoIdList 多个视频id的集合
     * @return Result统一结果
     */
    @DeleteMapping("/eduvod/video/delete-batch")
    Result deleteBatch(@RequestParam("videoIdList") List<String> videoIdList);
}
